import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// // 查询列表
// export const getDataByPage = (params: object) => {
//   return http.post<Login.ResLogin>(PORT1 + `/secure/mirrList/${params.pageNum}/${params.pageSize}`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
// };
// // 新增
// export const addData = (params: object) => {
//   return http.post<Login.ResLogin>(PORT1 + `/secure/mirrAdd`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
// };
// // 更新
// export const editData = (params: object) => {
//   return http.post<Login.ResLogin>(PORT1 + `/secure/mirrUpdate`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
// };
// // 删除列表
// export const deleteData = (params: object) => {
//   return http.post<Login.ResLogin>(PORT1 + `/secure/mirrDel`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
// };
// // 获取配置
// export const getInfo = (params: object) => {
//   return http.post<Login.ResLogin>(PORT1 + `/secure/mirrCfg/${params.id}`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
// };
// 查询列表
export const getDataByPage = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/defense/mirror/mirror_list/${params.pageNum}/${params.pageSize}`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addData = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/defense/mirror/mirror_add`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editData = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/defense/mirror/mirror_update`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteData = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/defense/mirror/mirror_del`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 获取配置
export const getInfo = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/defense/mirror/mirror_cfg/${params.id}`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 下载模板
export const downloadTemplate = (params: object) => {
  return http.post(PORT1 + `/secure/mirrDownloadTemp`, params, { loading: false, responseType: "blob" }); // 正常 post json 请求  ==>  application/json
};
// 导入
export const importData = (params: object) => {
  return http.post(PORT1 + `/secure/mirrImport`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 导出
export const exportData = () => {
  return http.get(PORT1 + `/secure/mirrExport`,{}, { loading: false, responseType: "blob" }); // 正常 post json 请求  ==>  application/json
};
// 清空
export const clearData = () => {
  return http.get(PORT1 + `/defense/mirror/mirror_clear`,{}); // 正常 post json 请求  ==>  application/json
};
